# Contributor: David Florness <david@florness.com>
# Maintainer: David Florness <david@florness.com>
pkgname=gopls
pkgver=0.4.4
pkgrel=0
pkgdesc="Language server for Go programming language"
url="https://github.com/golang/tools/blob/master/gopls"
arch="all !mips !mips64" # go is missing
options="chmod-clean"
license="BSD-3-Clause"
makedepends="go>=1.12"
source="$pkgname-$pkgver.tar.gz::https://github.com/golang/tools/archive/gopls/v$pkgver.tar.gz"
builddir="$srcdir/tools-$pkgname-v$pkgver/$pkgname"
export GOPATH="$srcdir"

check() {
	cd "test"
	go test
}

build() {
	go build -o "$pkgname" -trimpath
}

package() {
	install -Dm755 "$builddir/$pkgname" -t "$pkgdir"/usr/bin/
}

sha512sums="b2b51bcbe6f62a8c4e4a322e1883ef10cac37d0f3e13a9321eac1c8db624daf07a74b6955825a0563986f169f9e6dbb0b302d0414ebe6b90165b42daa810441d  gopls-0.4.4.tar.gz"
